import request from '@/config/axios'

// 观众 VO
export interface AudienceVO {
  id: number // 编号
  name: string // 名字
  description: string // 简介
  telephone: string // 电话
  mobilePhone: string // 手机
  email: string // 邮件
  gender: string // 性别
  status: number // 状态
}

// 观众 API
export const AudienceApi = {
  // 查询观众分页
  getAudiencePage: async (params: any) => {
    return await request.get({ url: `/exhibition/audience/page`, params })
  },

  // 查询观众详情
  getAudience: async (id: number) => {
    return await request.get({ url: `/exhibition/audience/get?id=` + id })
  },

  // 新增观众
  createAudience: async (data: AudienceVO) => {
    return await request.post({ url: `/exhibition/audience/create`, data })
  },

  // 修改观众
  updateAudience: async (data: AudienceVO) => {
    return await request.put({ url: `/exhibition/audience/update`, data })
  },

  // 删除观众
  deleteAudience: async (id: number) => {
    return await request.delete({ url: `/exhibition/audience/delete?id=` + id })
  },

  // 导出观众 Excel
  exportAudience: async (params) => {
    return await request.download({ url: `/exhibition/audience/export-excel`, params })
  }
}